import * as echarts from "echarts";
export const weldingSpotPrice1 = () => {
  return {
    title: {
      text: "焊点经济性【电极帽+铣刀】",
      textStyle: {
        color: "#fff",
        fontSize: "14px",
      },
    },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        lineStyle: {
          color: "#57617B",
        },
      },
      formatter: "{b}	<br/> 焊点单价 : {c} 元",
    },
    toolbox: {
      show: true,
      feature: {
        dataZoom: {
          yAxisIndex: "none",
        },
        // dataView: { readOnly: false },
        // magicType: { type: ["line", "bar"] },
        // restore: {},
        // saveAsImage: {},
      },
    },

    grid: {
      left: "0",
      right: "20",
      top: "50",
      bottom: "0",
      containLabel: true,
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        axisLine: {
          show: false,
          lineStyle: {
            color: "rgba(255,255,255,.6)",
          },
        },
        data: ["10.2", "10.3", "10.4", "10.5", "10.6", "10.7"],
      },
    ],
    yAxis: [
      {
        axisLabel: {
          show: true,
          textStyle: {
            color: "rgba(255,255,255,.6)",
          },
        },
        axisLine: {
          show: false,
        },
        splitLine: {
          lineStyle: {
            type: "dotted",
            color: "rgba(255,255,255,.1)",
          },
        },
      },
    ],
    series: [
      {
        name: "焊点单价",
        type: "line",
        smooth: true,
        symbol: "circle",
        symbolSize: 5,
        showSymbol: false,
        lineStyle: {
          normal: {
            width: 2,
          },
        },

        areaStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              0,
              0,
              1,
              [
                {
                  offset: 0,
                  color: "rgba(98, 201, 141, 0.5)",
                },
                {
                  offset: 1,
                  color: "rgba(98, 201, 141, 0.1)",
                },
              ],
              false
            ),
            shadowColor: "rgba(0, 0, 0, 0.1)",
            shadowBlur: 10,
          },
        },
        itemStyle: {
          normal: {
            color: "#4cb9cf",
            borderColor: "rgba(98, 201, 141,0.27)",
            borderWidth: 12,
          },
        },
        data: [91, 60, 70, 54, 80, 40],
      },
    ],
  };
};

export const weldingSpotPrice2 = () => {
  return {
    title: {
      text: "电极帽经济性【电极帽/焊点】",
      textStyle: {
        color: "#fff",
        fontSize: "14px",
      },
    },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        lineStyle: {
          color: "#57617B",
        },
      },
      formatter: function (data) {
        return data[0].name + "	<br/> 焊点单价 : " + data[0].data.toFixed(2) + " 元";
      },
      // formatter: "{b}	<br/> 焊点单价 : {c} 元",
    },
    toolbox: {
      show: true,
      feature: {
        dataZoom: {
          yAxisIndex: "none",
        },
        // dataView: { readOnly: false },
        // magicType: { type: ["line", "bar"] },
        // restore: {},
        // saveAsImage: {},
      },
    },

    grid: {
      left: "0",
      right: "20",
      top: "50",
      bottom: "0",
      containLabel: true,
    },

    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        axisLine: {
          show: false,
          lineStyle: {
            color: "rgba(255,255,255,.6)",
          },
        },
        data: ["10.2", "10.3", "10.4", "10.5", "10.6", "10.7"],
      },
    ],
    yAxis: [
      {
        axisLabel: {
          show: true,
          textStyle: {
            color: "rgba(255,255,255,.6)",
          },
        },
        axisLine: {
          show: false,
        },
        splitLine: {
          lineStyle: {
            type: "dotted",
            color: "rgba(255,255,255,.1)",
          },
        },
      },
    ],
    series: [
      {
        name: "焊点单价",
        type: "line",
        smooth: true,
        symbol: "circle",
        symbolSize: 5,
        showSymbol: false,
        lineStyle: {
          normal: {
            width: 2,
          },
        },

        areaStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              0,
              0,
              1,
              [
                {
                  offset: 0,
                  color: "rgba(98, 201, 141, 0.5)",
                },
                {
                  offset: 1,
                  color: "rgba(98, 201, 141, 0.1)",
                },
              ],
              false
            ),
            shadowColor: "rgba(0, 0, 0, 0.1)",
            shadowBlur: 10,
          },
        },
        itemStyle: {
          normal: {
            color: "#4cb9cf",
            borderColor: "rgba(98, 201, 141,0.27)",
            borderWidth: 12,
          },
        },
        data: [60, 90, 70, 54, 60, 40],
      },
    ],
  };
};

export const weldingSpotPrice3 = {
  title: {
    text: "铣刀经济性【铣刀片/焊点】",
    textStyle: {
      color: "#fff",
      fontSize: "14px",
    },
  },
  tooltip: {
    trigger: "axis",
    axisPointer: {
      lineStyle: {
        color: "#57617B",
      },
    },
    formatter: "{b}	<br/> 焊点单价 : {c} 元",
  },
  toolbox: {
    show: true,
    feature: {
      dataZoom: {
        yAxisIndex: "none",
      },
      // dataView: { readOnly: false },
      // magicType: { type: ["line", "bar"] },
      // restore: {},
      // saveAsImage: {},
    },
  },

  grid: {
    left: "0",
    right: "20",
    top: "50",
    bottom: "0",
    containLabel: true,
  },
  xAxis: [
    {
      type: "category",
      boundaryGap: false,
      axisLine: {
        show: false,
        lineStyle: {
          color: "rgba(255,255,255,.6)",
        },
      },
      data: ["10.2", "10.3", "10.4", "10.5", "10.6", "10.7"],
    },
  ],
  yAxis: [
    {
      axisLabel: {
        show: true,
        textStyle: {
          color: "rgba(255,255,255,.6)",
        },
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          type: "dotted",
          color: "rgba(255,255,255,.1)",
        },
      },
    },
  ],
  series: [
    {
      name: "焊点单价",
      type: "line",
      smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          width: 2,
        },
      },

      areaStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            [
              {
                offset: 0,
                color: "rgba(98, 201, 141, 0.5)",
              },
              {
                offset: 1,
                color: "rgba(98, 201, 141, 0.1)",
              },
            ],
            false
          ),
          shadowColor: "rgba(0, 0, 0, 0.1)",
          shadowBlur: 10,
        },
      },
      itemStyle: {
        normal: {
          color: "#4cb9cf",
          borderColor: "rgba(98, 201, 141,0.27)",
          borderWidth: 12,
        },
      },
      data: [22, 55, 44, 54, 33, 40],
    },
  ],
};

export const faultStatistics = {
  title: {
    text: "焊接故障统计",
    textStyle: {
      color: "#fff",
      fontSize: "14px",
    },
  },
  tooltip: {
    trigger: "axis",

    axisPointer: {
      type: "shadow",
    },
  },
  toolbox: {
    show: true,
    feature: {
      dataZoom: {
        yAxisIndex: "none",
      },
      // dataView: { readOnly: false },
      // magicType: { type: ["line", "bar"] },
      // restore: {},
      // saveAsImage: {},
    },
  },
  legend: {
    data: ["故障次数", "粘掉帽次数"],
    // top: "middle",
    textStyle: { color: "#fff" },
  },
  grid: {
    left: "0",
    top: "50",
    right: "10",
    bottom: "0",
    containLabel: true,
  },

  xAxis: [
    {
      type: "category",
      boundaryGap: false,
      data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
      axisLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
        },
      },
      axisLabel: {
        //   margin: 10,
        color: "#e2e9ff",
        textStyle: {
          fontSize: 14,
        },
      },
    },
  ],
  yAxis: [
    {
      splitNumber: 3,
      axisLabel: {
        formatter: "{value}",
        color: "#e2e9ff",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
          type: "dotted",
        },
      },
    },
  ],
  series: [
    {
      name: "故障次数",
      type: "line",
      //  smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          color: "#fbc20e",
          width: 2,
        },
      },

      itemStyle: { normal: { color: "#fbc20e" } },
      data: [6, 2, 5, 1, 7, 4, 13, 4, 18, 6, 8, 4],
    },
    {
      name: "粘掉帽次数",
      type: "line",
      //   smooth: true,
      symbol: "circle",
      symbolSize: 3,
      showSymbol: false,
      lineStyle: {
        normal: {
          color: "#58c8da",
          width: 2,
        },
      },
      itemStyle: { normal: { color: "#58c8da" } },
      data: [4, 6, 4, 8, 6, 8, 4, 6, 2, 5, 1, 7],
    },
  ],
};
export const frictionForce = {
  title: {
    text: "摩擦力最大值趋势",
    textStyle: {
      color: "#fff",
      fontSize: "14px",
    },
  },
  tooltip: {
    trigger: "axis",

    axisPointer: {
      type: "shadow",
    },
  },
  toolbox: {
    show: true,
    // top: "top",
    left: "center",
    feature: {
      dataZoom: {
        yAxisIndex: "none",
      },
      // dataView: { readOnly: false },
      // magicType: { type: ["line", "bar"] },
      // restore: {},
      // saveAsImage: {},
    },
  },

  grid: {
    left: "0",
    top: "50",
    right: "10",
    bottom: "0",
    containLabel: true,
  },

  xAxis: [
    {
      type: "category",
      boundaryGap: false,
      data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
      axisLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
        },
      },
      axisLabel: {
        //   margin: 10,
        color: "#e2e9ff",
        textStyle: {
          fontSize: 14,
        },
      },
    },
  ],
  yAxis: [
    {
      splitNumber: 3,
      axisLabel: {
        formatter: "{value}",
        color: "#e2e9ff",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
          type: "dotted",
        },
      },
    },
  ],
  series: [
    {
      // name: "故障次数",
      type: "line",
      //  smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          color: "#fc8452",
          width: 2,
        },
      },

      itemStyle: { normal: { color: "#fc8452" } },
      data: [6, 12, 15, 11, 7, 4, 13, 4, 18, 6, 5, 4],
      markPoint: {
        data: [{ type: "max", name: "Max" }],
      },
    },
  ],
};
export const errorCount = {
  title: {
    text: "滞后误差报错次数",
    textStyle: {
      color: "#fff",
      fontSize: "14px",
    },
  },
  tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "shadow",
    },
  },
  toolbox: {
    show: true,
    // top: "top",
    left: "center",
    feature: {
      dataZoom: {
        yAxisIndex: "none",
      },
      // dataView: { readOnly: false },
      // magicType: { type: ["line", "bar"] },
      // restore: {},
      // saveAsImage: {},
    },
  },
  color: ["#248ff7", "#64cd84"],
  legend: {
    data: ["779", "虚拟轴"],
    right: "top",
    textStyle: { color: "#fff" },
    itemWidth: 15,
    itemHeight: 10,
  },
  grid: {
    left: "0",
    top: "50",
    right: "10",
    bottom: "0",
    containLabel: true,
  },

  xAxis: [
    {
      type: "category",
      // boundaryGap: false,
      data: ["1", "2", "3", "4", "5"],
      axisLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
        },
      },
      axisLabel: {
        //   margin: 10,
        color: "#e2e9ff",
        textStyle: {
          fontSize: 14,
        },
      },
    },
  ],
  yAxis: [
    {
      splitNumber: 3,
      axisLabel: {
        formatter: "{value}",
        color: "#e2e9ff",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
          type: "dotted",
        },
      },
    },
  ],
  series: [
    {
      name: "779",
      type: "bar",
      stack: "排名",
      data: [120, 132, 101, 134, 90],
      barWidth: 15,
      itemStyle: {
        normal: {
          barBorderRadius: [0, 0, 30, 30],
        },
      },
    },
    {
      name: "虚拟轴",
      type: "bar",
      stack: "排名",
      data: [220, 182, 191, 234, 290],
      barWidth: 15,
      itemStyle: {
        normal: {
          barBorderRadius: [30, 30, 0, 0],
        },
      },
    },
  ],
};
export const clampingTime = {
  title: {
    text: "夹紧时间",
    textStyle: {
      color: "#fff",
      fontSize: "14px",
    },
  },
  tooltip: {
    trigger: "axis",

    axisPointer: {
      type: "shadow",
    },
  },
  toolbox: {
    show: true,
    // top: "top",
    // left: "center",
    feature: {
      dataZoom: {
        yAxisIndex: "none",
      },
      // dataView: { readOnly: false },
      // magicType: { type: ["line", "bar"] },
      // restore: {},
      // saveAsImage: {},
    },
  },

  grid: {
    left: "0",
    top: "50",
    right: "10",
    bottom: "0",
    containLabel: true,
  },

  xAxis: [
    {
      type: "category",
      boundaryGap: false,
      data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
      axisLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
        },
      },
      axisLabel: {
        //   margin: 10,
        color: "#e2e9ff",
        textStyle: {
          fontSize: 14,
        },
      },
    },
  ],
  yAxis: [
    {
      splitNumber: 3,
      axisLabel: {
        formatter: "{value}",
        color: "#e2e9ff",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
          type: "dotted",
        },
      },
    },
  ],
  series: [
    {
      // name: "故障次数",
      type: "line",
      //  smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          color: "#9a60b4",
          width: 2,
        },
      },

      itemStyle: { normal: { color: "#9a60b4" } },
      data: [11, 2, 5, 22, 7, 4, 13, 3, 18, 6, 8, 4],
      markPoint: {
        data: [{ type: "max", name: "Max" }],
      },
    },
  ],
};
export const millingAmount = {
  title: {
    text: "铣削量对比",
    textStyle: {
      color: "#fff",
      fontSize: "14px",
    },
  },
  tooltip: {
    trigger: "axis",

    axisPointer: {
      type: "shadow",
    },
  },
  legend: {
    data: ["静极臂", "动极臂"],
    // right: "top",
    textStyle: { color: "#fff" },
  },
  grid: {
    left: "0",
    top: "50",
    right: "10",
    bottom: "0",
    containLabel: true,
  },

  xAxis: [
    {
      type: "category",
      boundaryGap: false,
      data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
      axisLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
        },
      },
      axisLabel: {
        //   margin: 10,
        color: "#e2e9ff",
        textStyle: {
          fontSize: 14,
        },
      },
    },
  ],
  yAxis: [
    {
      splitNumber: 3,
      axisLabel: {
        formatter: "{value}",
        color: "#e2e9ff",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,0.12)",
          type: "dotted",
        },
      },
    },
  ],
  series: [
    {
      name: "静极臂",
      type: "line",
      //  smooth: true,
      symbol: "circle",
      symbolSize: 5,
      showSymbol: false,
      lineStyle: {
        normal: {
          color: "#fbc20e",
          width: 2,
        },
      },

      itemStyle: { normal: { color: "#fbc20e" } },
      data: [6, 2, 5, 1, 7, 4, 13, 4, 18, 6, 8, 4],
    },
    {
      name: "动极臂",
      type: "line",
      //   smooth: true,
      symbol: "circle",
      symbolSize: 3,
      showSymbol: false,
      lineStyle: {
        normal: {
          color: "#58c8da",
          width: 2,
        },
      },
      itemStyle: { normal: { color: "#58c8da" } },
      data: [4, 6, 4, 8, 6, 8, 4, 6, 2, 5, 1, 7],
    },
  ],
};
